package com.tanhua.dubbo.mappers;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.model.db.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository//保存用户信息的mapper
public interface UserInfoMapper extends BaseMapper<UserInfo> {

    /*
   SELECT * FROM tb_user WHERE id IN (SELECT black_user_id FROM tb_black_list WHERE user_id=106)
        */
    @Select("select * from tb_user_info where id in( select black_user_id from tb_black_list where  user_id=#{userId})")
    IPage<UserInfo> findBlackList(@Param("page")Page<UserInfo> page, @Param("userId") Long userId );
    //这里不使用Mybatis-plus查询,而是自定义方法



}
